1 <?php include ( "../inc/connect.inc.php" ); ?>
2 <?php
3 ob_start();
4 session_start();

5 if
(!isset($_SESSION['user_login'])) {
6     $user =
"";
7 }

8 else
{
9     $user = $_SESSION[
'user_login'];
10     $result = mysql_query(
"SELECT * FROM user WHERE id='$user'");
11         $get_user_email = mysql_fetch_assoc($result);
12             $uname_db = $get_user_email[
'firstName'];
13 }

14 if
(isset($_REQUEST['pid'])) {
15     
16     $pid = mysql_real_escape_string($_REQUEST[
'pid']);
17 }
else {
18     header(
'location: index.php');
19 }
20
21
22 $getposts = mysql_query(
"SELECT * FROM products WHERE id ='$pid'") or die(mysql_error());
23                     
if (mysql_num_rows($getposts)) {
24                         $row = mysql_fetch_assoc($getposts);
25                         $id = $row[
'id'];
26                         $pName = $row[
'pName'];
27                         $price = $row[
'price'];
28                         $description = $row[
'description'];
29                         $picture = $row[
'picture'];
30                         $item = $row[
'item'];
31                         $available =$row[
'available'];
32                     }
33
34 ?>
35
36 <!DOCTYPE html>
37 <html>
38 <head>
39     <title>SAREE</title>
40     <link rel=
"stylesheet" type="text/css" href="../css/style.css">
41     <meta name=
"viewport" content="width=device-width, initial-scale=1">
42 </head>
43 <body>
44     <?php include (
"../inc/mainheader.inc.php" ); ?>
45     <div
class="categolis">
46         <table>
47             <tr>
48                 <th>
49                     <a href=
"saree.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">Saree</a>
50                 </th>
51                 <th><a href=
"ornament.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">Ornament</a></th>
52                 <th><a href=
"watch.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">Watch</a></th>
53                 <th><a href=
"perfume.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">Perfume</a></th>
54                 <th><a href=
"hijab.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">Hijab</a></th>
55                 <th><a href=
"tshirt.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">T-Shirt</a></th>
56                 <th><a href=
"footwear.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">FootWear</a></th>
57                 <th><a href=
"toilatry.php" style="text-decoration: none;color: #ddd;padding: 4px 12px;background-color: #c7587e;border-radius: 12px;">Toilatry</a></th>
58             </tr>
59         </table>
60     </div>
61     <div style=
"margin: 0 97px; padding: 10px">
62
63         <?php
64             echo
'
65                 <div style=
"float: left;">
66                 <div>
67                     <img src=
"../image/product/'.$item.'/'.$picture.'" style="height: 500px; width: 500px; padding: 2px; border: 2px solid #c7587e;">
68                 </div>
69                 </div>
70                 <div style=
"float: right;width: 40%;color: #067165;background-color: #ddd;padding: 10px;">
71                     <div style=
"">
72                         <h3 style=
"font-size: 25px; font-weight: bold; ">'.$pName.'</h3><hr>
73                         <h3 style=
"padding: 20px 0 0 0; font-size: 20px;">Prize: '.$price.' Tk</h3><hr>
74                         <h3 style=
"padding: 20px 0 0 0; font-size: 22px; ">Description:</h3>
75                         <p>
76                             
'.$description.'
77                         </p>
78
79                         <div>
80                             <h3 style=
"padding: 20px 0 5px 0; font-size: 20px;">Want to buy this product? </h3>
81                             <div id=
"srcheader">
82                                 <form id=
"" method="post" action="../orderform.php?poid='.$pid.'">
83                                         <input type=
"submit" value="Order Now" class="srcbutton" >
84                                 </form>
85                                 <div
class="srcclear"></div>
86                             </div>
87                         </div>
88
89                     </div>
90                 </div>
91
92             
';
93         ?>
94
95     </div>
96     <div style=
"padding: 30px 95px; font-size: 25px; margin: 0 auto; display: table; width: 98%;">
97         <h3 style=
"padding-bottom: 20px">Recommand Product For You:</h3>
98         <div>
99         <?php
100             $getposts = mysql_query(
"SELECT * FROM products WHERE available >='1' AND id != '".$pid."' AND item ='".$item."' ORDER BY RAND() LIMIT 3") or die(mysql_error());
101                     
if (mysql_num_rows($getposts)) {
102                     echo
'<ul id="recs">';
103                     
while ($row = mysql_fetch_assoc($getposts)) {
104                         $id = $row[
'id'];
105                         $pName = $row[
'pName'];
106                         $price = $row[
'price'];
107                         $description = $row[
'description'];
108                         $picture = $row[
'picture'];
109                         
110                         echo
'
111                             <ul style=
"float: left;">
112                                 <li style=
"float: left; padding: 0px 25px 25px 25px;">
113                                     <div
class="home-prodlist-img"><a href="view_product.php?pid='.$id.'">
114                                         <img src=
"../image/product/'.$item.'/'.$picture.'" class="home-prodlist-imgi">
115                                         </a>
116                                         <div style=
"text-align: center; padding: 0 0 6px 0;"> <span style="font-size: 15px;">'.$pName.'</span><br> Price: '.$price.' Tk</div>
117                                     </div>
118                                     
119                                 </li>
120                             </ul>
121                         
';
122
123                         }
124                 }
125         ?>
126             
127         </div>
128     </div>
129 </body>
130 </html>


Gõ tìm kiếm nhanh...